package com.itheima.bakery.demos.web.controller;
import com.itheima.bakery.demos.web.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SearchController {

    @Autowired
    private SearchService searchService;

    @GetMapping("/global-search")
    public List<Object> globalSearch(@RequestParam String keyword) {
        return searchService.globalSearch(keyword);
    }
}